<template>
  <div class="page-department">
    <div class="component-mainHeader">
      <div class="top">
        <div class="topleft">
          <p>
            <span class="iconfont" style="color:#1abc9a;margin-right:3px;">&#xe607;</span>查看详情
          </p>
        </div>
        <div class="topright">
          <el-button type="info" @click="info_btn">
            <span style="font-weight:700;margin-right:5px;" class="iconfont">&#xe606;</span>返回
          </el-button>
        </div>
      </div>
    </div>

    <!-- 表格 -->
    <div class="table">
      <el-table ref="multipleTable" :data="info" tooltip-effect="dark" style border>
        <el-table-column label="库号" align="center" width="180" prop="userName"></el-table-column>
        <el-table-column label="材料名称" align="center" width="180" prop="userOrg"></el-table-column>

        <el-table-column label="型号" align="center" width="180" prop="name1"></el-table-column>
        <el-table-column label="领用数量" align="center" width="180" prop="name2"></el-table-column>

        <el-table-column label="甲供剩余数量" align="center" width="180" prop="name3"></el-table-column>

        <el-table-column label="仓库剩余数量" align="center" prop="name"></el-table-column>
      </el-table>
    </div>

    <!-- 分页 -->
    <div class="component-paging" v-if="info.length > 0">
      <div class="table-bottom">
        <div class="bottom-left"></div>
        <div class="paging">
          <div class="paging-left">
            <p>
              共
              <span>{{Math.ceil(total/pageSize)}}</span> 页/
              <span>{{total}}</span> 条数据
            </p>
          </div>
          <el-pagination
            background
            @size-change="SizeChange($event,dataInit,currentPage,pageSize)"
            @current-change="CurrentChange($event,dataInit,currentPage,pageSize)"
            :current-page="currentPage"
            :page-sizes="[10, 20, 30]"
            :page-size="pageSize"
            layout="sizes, prev, pager, next, jumper"
            :total="total"
          ></el-pagination>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "viewDetails",
  data() {
    return {
      ruleForm: {
        userName: "",
        userOrg: "",
        name1: "",
        name2: "",
        name3: ""
      },
      info: [
        {
          userName: "1001",
          userOrg: "施工队长",
          name1: "80",
          name2: "80",
          name3: "80"
        }
      ],
      limit: true,
      // 数据总条数
      total: 0,
      // 每页显示数据的条数
      pageSize: 10,
      // 当前显示的页面页码
      currentPage: 1
    };
  },
  mounted() {},
  methods: {
    // 添加按钮
    addRadio() {
      this.todos.push(this.item);
      console.log(1);
    },
    info_btn(){
       this.$router.go(-1);
    }
  }
};
</script>

<style scoped>
.component-searchHeader .search-header {
  width: 1100px;
  box-sizing: border-box;
  border: 1px solid rgba(228, 228, 228, 1);
  background-color: rgba(255, 255, 255, 1);
  margin: 20px auto 0;
}

.component-searchHeader .search-header .left-title {
  display: flex;
  justify-content: space-between;
  width: 100%;
  background-color: rgba(243, 243, 243, 1);
  height: 45px;
  box-sizing: border-box;
}

.component-searchHeader .search-header .left-title .left-text {
  width: 20%;
  color: #666;
  line-height: 45px;
  font-family: "微软雅黑";
  font-weight: 400;
  font-size: 12px;
  text-align: left;
  margin: 0 0 0 30px;
}

.component-searchHeader .right {
  width: 70%;
  display: flex;
  justify-content: flex-end;
  margin-right: 30px;
}

.component-listHeader .search-header .left-title {
  display: flex;
  justify-content: space-between;
  width: 100%;
  background-color: rgba(243, 243, 243, 1);
  height: 45px;
  box-sizing: border-box;
}

.component-listHeader .search-header .left-title .left-text {
  width: 20%;
  color: #666;
  line-height: 45px;
  font-family: "微软雅黑";
  font-weight: 400;
  font-size: 12px;
  text-align: left;
  margin: 0 0 0 30px;
}

.table {
  width: 1100px;
  margin: 0 auto;
  margin-top: 30px;
}

.el-table .cell a {
  color: #1abc9a;
  text-decoration: none;
  cursor: pointer;
}
</style>
